package fr.miage.ageco.dataaccess;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import fr.miage.ageco.dataaccess.bo.Competence;
import fr.miage.ageco.dataaccess.bo.Employe;
import fr.miage.ageco.dataaccess.services.CompetenceService;
import fr.miage.ageco.dataaccess.services.EmployeService;
import fr.miage.ageco.dataaccess.services.EtapeProjetService;

/**
 * Hello world!
 * 
 */
public class App {
	public static void main(String[] args) {
		ApplicationContext cxt = new ClassPathXmlApplicationContext(
				"conf/spring/applicationContext.xml");
		EmployeService employeService = (EmployeService) cxt
				.getBean("employeService");
		
		CompetenceService competenceService = (CompetenceService) cxt
				.getBean("competenceService");
		
		EtapeProjetService etapeprojetService = (EtapeProjetService) cxt
				.getBean("etapeProjetService");

		Employe empl = new Employe();
		empl.setNom("test");
		empl.setPrenom("ggggg");
		empl.setFonction("Developpeur");
		empl.setAgence("");
		empl.setEmail("");
		empl.setEtp(0.0);
		//empl.setNaissance("");
		
		employeService.insertEmploye(empl);
		
		Competence comp = new Competence();
		comp.setNom("Comp1");
		
		competenceService.insertCompetence(comp);

		//System.out.println(employeService.getAllEmploye());
		//System.out.println(employeService.getEmploye(1).getNom());
		
		System.out.println(competenceService.getAllCompetences());
		

		System.out.println(etapeprojetService.getEtapeProjetForEmploye(121));

	}
}
